"""
题目三：新建“test3”Python文件：读取“天气预报Json”文件，要求输出苏州市未来3天的温度和天气情况。（30分）
"""
import json


def weather():  # 读取天气预报json文件
    with open('天气预报json.txt', 'r', encoding='utf-8')as f:
        s = json.load(f)
        for i in range(1, 4):
            a1 = s['result']['future'][i - 1]["temperature"]
            a2 = s['result']['future'][i - 1]["weather"]
            a3 = s['result']['future'][i - 1]["direct"]
            print(f'未来第{i}天的温度是：{a1},', end='')
            print(f'天气情况是：{a2},', end='')
            print(f'风向是:{a3}')


if __name__ == '__main__':
    weather()
